# -*- encoding:utf-8 -*-
# __author__ = 'chenyongbing'
# __poject__ = 'ops_platform'
# __datetime__ = '2022/3/3'
# __name__ = 'pagination.py'
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
# Create your code here.

class ElementUIPagination(PageNumberPagination):

    # page_size = 10
    max_page_size = 1000
    page_size_query_param = 'page_size'




    def get_paginated_response(self, data):
        return Response({
            'code': 20000,
            'total': self.page.paginator.count,
            'data': data,
            'page': self.page.number,
            # 'page_size': self.page_size
        })